find the length of a diagonal